package com.dsg.controller;

import com.dsg.entity.Contract;
import com.dsg.entity.Contractstart;
import com.dsg.entity.Contracttype;
import com.dsg.service.ContractService;
import com.dsg.vo.ContractDto;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class ContractController {
    @Resource
    private ContractService contractService;
    @GetMapping("/contract")
    public String cont(){
        return "/cont/ContCreation";
    }
    @GetMapping("/QueryAllcon")
    @ResponseBody
    public List<Contractstart> QueryAllContractroller(){
        return contractService.seachAllContractstart();

    }
    @GetMapping("/QueryAlltype")
    @ResponseBody
    public List<Contracttype> QueryAllContracttype(){
        return contractService.seachAllContracttype();
    }
    @GetMapping("/Querylist")
    @ResponseBody
    public List<Contract> QueryAllContract(ContractDto contractDto){
        return contractService.seachAllContract(contractDto);
    }
}
